package com.express.web;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.express.param.ClientVersion;
import com.express.param.FindAppVersionReq;
import com.express.param.MsgResponse;
import com.express.service.AppVersionCodeService;

@Controller
@RequestMapping("/appVersion")
public class AppVersionCtrl extends AbstractController{
	
	
	@Autowired
	private AppVersionCodeService appVersionCodeService;
	
	/**
	 * 
	* @Title: findAppVersion 
	* @Description: 查询是否有新版本需要更新
	* @param @param req
	* @param @return    
	* @return MsgResponse    
	* @throws
	 */
	@RequestMapping(value="/findAppVersion",method=RequestMethod.POST)
	@ResponseBody
	public MsgResponse findAppVersion(@RequestBody @Valid FindAppVersionReq req){
		MsgResponse msgResponse = new MsgResponse();
		ClientVersion clientVersion = appVersionCodeService.findAppVersion(req);
		msgResponse.setData(clientVersion);
		return msgResponse;
		
		
	}
	
}
